<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>基础信息设置</title>
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="/static/assets/module/admin.css?v=312" />
    <style>
        .layui-form-item {
            margin-bottom: 25px;
        }

        label .layui-icon {
            font-size: 14px;
            color: #666;
        }
    </style>
</head>

<body>
    <!-- 正文开始 -->
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">信息配置</div>
            <div class="layui-card-body">
                <div class="layui-tab">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基本信息</li>
                        <li>导航追加</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <blockquote class="layui-elem-quote">修改指南: 修改后直接提交即可!</blockquote>
                            <form class="layui-form" style="max-width: 700px;">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">网站标题:</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="site_title" placeholder="网站首页标题" class="layui-input"
                                            lay-verType="tips" lay-verify="required" value="{$info['site_title']}"
                                            required />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">首页关键词:</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="site_keyword" placeholder="首页关键词，内容页面也会用到"
                                            class="layui-input" lay-verType="tips" lay-verify="required"
                                            value="{$info['site_keyword']}" required />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">首页描述:</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" name="site_description" placeholder="首页描述，请完善填写"
                                            class="layui-textarea" lay-verify="required"
                                            required>{$info['site_description']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">标题简称:</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="site_suffix" placeholder="标题尾巴" class="layui-input"
                                            lay-verType="tips" lay-verify="required" value="{$info['site_suffix']}"
                                            required />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">友情链接:</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" name="site_link" placeholder="友情链接" class="layui-textarea"
                                            lay-verify="required" required>{$info['site_link']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">导航顶部:</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" name="site_top" placeholder="导航顶部" class="layui-textarea"
                                            lay-verify="required" required>{$info['site_top']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">站点底部:</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" name="site_footer" placeholder="全站底部"
                                            class="layui-textarea" lay-verify="required"
                                            required>{$info['site_footer']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-filter="formSubmitBas"
                                            lay-submit>&emsp;提交&emsp;</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">&emsp;重置&emsp;</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="layui-tab-item">
                            <form class="layui-form" style="max-width: 700px;">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">导航代码:</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" name="site_nav" placeholder="导航代码" class="layui-textarea"
                                            lay-verify="required" required>{$info['site_nav']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-filter="formSubmitBas2"
                                            lay-submit>&emsp;提交&emsp;</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">&emsp;重置&emsp;</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- js部分 -->
    <script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="/static/assets/js/common.js?v=312"></script>
    <script>
        layui.use(['layer', 'form', 'element', 'laydate'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var form = layui.form;
            var element = layui.element;
            // 监听表单提交
            form.on('submit(formSubmitBas)', function (data) {
                $.ajax({
                    type: "POST",
                    url: "{:url('admin/system/index')}",
                    data: data.field,
                    dataType: "json",
                    success: function (data) {
                        if (data.code == 0) {
                            layer.alert(data.msg);
                        } else {
                            layer.alert(data.msg);
                        }
                    },
                    error: function (data) {
                        alert("请求失败");
                    }
                });

                return false;
            });
            // 监听表单提交2
            form.on('submit(formSubmitBas2)', function (data) {
                $.ajax({
                    type: "POST",
                    url: "{:url('admin/system/index')}",
                    data: data.field,
                    dataType: "json",
                    success: function (data) {
                        if (data.code == 0) {
                            layer.alert(data.msg);
                        } else {
                            layer.alert(data.msg);
                        }
                    },
                    error: function (data) {
                        alert("请求失败");
                    }
                });

                return false;
            });
        });
    </script>
</body>

</html>